package com.xiaoxian.system.service.impl;

import com.xiaoxian.basic.query.BaseQuery;
import com.xiaoxian.basic.service.impl.BaseServiceImpl;
import com.xiaoxian.basic.util.PageList;
import com.xiaoxian.system.domain.DictionaryDetail;
import com.xiaoxian.system.mapper.DictionaryDetailMapper;
import com.xiaoxian.system.service.IDictionaryDetailService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;
@Service
public class DictionaryDetailServiceImpl extends BaseServiceImpl<DictionaryDetail> implements IDictionaryDetailService {
    @Autowired
    private DictionaryDetailMapper dictionaryDetailMapper;
    /**
     * 获取详情
     * @param id
     * @return
     */
    @Override
    public List<DictionaryDetail> getDetail(Long id) {
        List<DictionaryDetail> list = new ArrayList<>();
        List<DictionaryDetail> all = dictionaryDetailMapper.findAll();
        for (DictionaryDetail dictionaryDetail : all) {
            if(dictionaryDetail.getTypes_id()==id){
                list.add(dictionaryDetail);
            }
        }
        return list;
    }
}
